interface Position<T> {
   x: T;
   y: T;
   toStrig: (x: T, y: T) => string;
}

const p1: Position<number> = {
   x: 12,
   y: 34,
   toStrig: (x, y) => {
      return `(${x},${y})`;
   },
};

const p2: Position<string> = {
   x: "12",
   y: "34",
   toStrig: (x, y) => {
      return `坐标[${x},${y}]`;
   },
};
